import request from '@/utils/request'

export const createOrUpdateMenu = (data:any):Promise<any> => {
  return request({
    method: 'POST',
    url: '/boss/menu/saveOrUpdate',
    data// axios 默认发送的 application/json格式的数据
  })
}

export const getEditMenuInfo = (id = -1) => {
  return request({
    method: 'GET',
    url: '/boss/menu/getEditMenuInfo',
    params: {
      id
    }
  })
}

export const getAllMenus = () => {
  return request({
    method: 'GET',
    url: '/boss/menu/getAll'
  })
}

export const deleteMenu = (id:number) => {
  return request({
    method: 'DELETE',
    url: `/boss/menu/${id}`
  })
}
